home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1996 September / JCSM Shareware Collection (JCS Distribution) (September 1996).ISO / bother__ / cenvid.zip / CENVIDOS.ZIP / CMDCOUNT.BAT < prev    next >
DOS Batch File  |  1994-12-01  |  1KB  |  33 lines

  1. @echo off
  2. REM ***************************************************
  3. REM *** CmdCount.bat - Repeat a command some number ***
  4. REM *** ver.2          of times.                    ***
  5. REM ***************************************************
  6.  
  7. REM ****************************************
  8. REM *** If no commands specified, then   ***
  9. REM *** give instructions for how to use ***
  10. REM ****************************************
  11. IF NOT "%2"=="" GOTO REPEAT_COMMAND
  12. ECHO CMDCOUNT.BAT - Repeat a command a number of times
  13. ECHO USAGE: CMDCOUNT Count Commands...
  14. ECHO WHERE: Count - Number of times to repeat command
  15. ECHO        Commands... - Any DOS command to repeat
  16. ECHO EXAMPLE: CMDCOUNT 5 COPY ALL.TXT+MYLINE.TXT
  17. GOTO BYE_BYE
  18.  
  19. :REPEAT_COMMAND
  20. REM **********************************************
  21. REM *** START COUNT ENVIRONMENT VARIABLE AT 0  ***
  22. REM *** LOOP THROUGH COMMANDS UNTIL IT REACHES ***
  23. REM *** THE FIRST INPUT VARIABLE               ***
  24. REM **********************************************
  25. SET COUNT=0
  26. :TOP_OF_LOOP
  27.    %2 %3 %4 %5 %6 %7 %8 %9
  28.    CEnviD COUNT = COUNT + 1
  29. IF NOT %COUNT%==%1 GOTO TOP_OF_LOOP
  30.  
  31. :BYE_BYE
  32. SET COUNT=
  33.